The ATSUMemoryCallbacks type is a union containing either pointers to your application-defined memory allocation functions or the heap that you want ATSUI to use when allocating memory. If you want to control memory allocation in ATSUI, you should supply pointers to your application-defined functions in the callbacks structure field of the union. If you want ATSUI to control memory allocation, you should supply the memory heap for ATSUI to use in the heapToUse field.
The ATSUMemoryCallbacks union is passed back by the function ATSUCreateMemorySetting to represent the newly-created memory setting.
union ATSUMemoryCallbacks {
struct {
ATSUCustomAllocFunc Alloc;
ATSUCustomFreeFunc Free;
ATSUCustomGrowFunc Grow;
void * memoryRefCon;
} callbacks;
THz heapToUse;
};
typedef union ATSUMemoryCallbacksATSUMemoryCallbacks;
Field descriptions
callbacks
A structure containing the Alloc, Free, Grow, and memoryRefCon fields. These fields contain pointers to your memory allocation callback functions, if they exist, and arbitrary data for use in your callback functions.
The Alloc field contains a pointer of type ATSUCustomAllocFunc to your memory allocation callback function.
The Free field contains a pointer of type ATSUCustomFreeFunc to your memory deallocation callback function.
The Grow field contains a pointer of type ATSUCustomGrowFunc to your memory reallocation callback function.
The memoryRefCon field contains a pointer to arbitrary data for use in your callback functions.
heapToUse
A pointer of type THz. Pass a pointer to the Zone structure that you want ATSUI to use for simple Memory Manager calls.